import { Controller, Get } from '@nestjs/common';
import { ProxyApiService } from '@/modules/proxy/proxy-api.service';
import { ProxyFetchService } from '@/modules/proxy/proxy-fetch.service';

@Controller("")
export class ProxyController {
  constructor(
    private readonly proxyApiService: ProxyApiService,
    private readonly proxyFetchService: ProxyFetchService,
  ) {}

  @Get("refresh_source")
  updateProxy() {
    return this.proxyFetchService.refreshSource()
  }

  @Get("verify_db")
  verifyDb() {
    return this.proxyFetchService.verifyDb()
  }

  @Get("reset_db")
  resetDb() {
    return this.proxyFetchService.resetDb()
  }
  @Get("get")
  getOneProxy() {
    return this.proxyApiService.getOneProxy()
  }

  @Get("debug")
  debug() {
    return this.proxyFetchService.debug()
  }
}